#include "startup.c"

extern int NEED_A();
extern int DEF_A_STEAL_B();
extern int DEF_C_STEAL_C();

/***
 *
 * Linker 
 *
 * ORDER : A, C
 * A: B
 * B: C
 *
 * BFS requires 'C' to overload 'B'
 * BFS requires 'A' to overload 'B' and 'C'
 */

int main(int argc, char* argv[]) {
  if (DEF_A_STEAL_B() == 'A') {
    puts("DEF_A_STEAL_B found before B as expected.\n");
  } else {
    puts("DEF_A_STEAL_B was not found in A.\n");
    return 2;
  }

  if (DEF_C_STEAL_B() == 'C') {
    puts("DEF_C_STEAL_B from C overrides B as expected.\n");
  } else {
    puts("DEF_C_STEAL_B failed to override B.\n");
    return 3;
  }
  
  if (NEED_A() == 'P') {
    puts("Reached A->B->C.\n");
  } else {
    puts("Failed A->B->C.\n");
    return 1;
  }

  puts("Passed.\n");
  return 0;
}

